package cn.tom.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

public class Cart {
    private Integer id;  
    private Integer uid;  // 购物车转订单, 前端无需上传
    private Book book = new Book();    //内嵌书本对象，购物车转订单 前端需要给 book.id 值就行， 其他留空
    private Integer num;
    private Double price;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date tcreate;   //购物车转订单, 前端无需上传


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Date getTcreate() {
        return tcreate;
    }

    public void setTcreate(Date tcreate) {
        this.tcreate = tcreate;
    }

    @Override
    public String toString() {
        return "Cart{" +
                "id=" + id +
                ", uid=" + uid +
                ", book=" + book +
                ", num=" + num +
                ", price=" + price +
                ", tcreate=" + tcreate +
                '}';
    }
}